/*
 * cpu_test.c
 *
 *  Created on: Mar 13, 2013
 *      Author: Aaron Kaufman
 */
#include <stdio.h>
#include <stdlib.h>
#include "cpu.h"
#include "ProcessScheduler.h"
#include "consumer.h"
#include "producer.h"
#include "timer.h"
#include "stdlib.h"
#include "keyboardInput.h"

int main2(){
	sharedMemory_t(mem);
    tdata_t(data);
    init_sharedMemory(&mem);
    init_data(&data, &mem);
    CPU cpu = *(CPU*) (malloc(sizeof(CPU)));
    createCPU(&cpu);
	timer_init(&cpu);
	create_keyboard_input_thread();
    addProcessToCPUProcessList(next_pro_instr, 5, &cpu, &mem, &data);
    addProcessToCPUProcessList(next_calc_instr, 1, &cpu, &mem, &data);
    addProcessToCPUProcessList(next_con_instr, 1, &cpu, &mem, &data);
    runCPU(ROUND_ROBIN, &cpu);


	return 0;
}
